home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qlib205.zip / QLIB.ZIP / TEST / SCANF.ASM < prev    next >
Assembly Source File  |  1996-12-18  |  919b  |  41 lines

  1. include qlib.inc
  2. include string.inc
  3. include stdio.inc
  4. include conio.inc
  5.  
  6. .data
  7.   str1 db 80 dup (0)
  8.   str2 db 80 dup (0)
  9.   dw1 dd 0
  10.   dw2 dd 0
  11.   dw3 dd 0
  12.   f1 real8 0.0
  13. .code
  14. main proc
  15.   call clrscr
  16.  
  17.   callp print,"Testing sscanf ...\n\n"
  18.  
  19.   callp sscanf,"The String\0011 with numbers in it\0 567567 0x400", \
  20.     "%s%b%s%d%x",offset str1,offset dw1,offset str2,offset dw2,offset dw3
  21.  
  22.   callp printf,"string = \"The String\\0011 with numbers in it\\0 567567 0x400\"\n\n"
  23.   callp printf," str1  = %s \n",offset str1
  24.   callp printf," dword1= %i \n",dw1
  25.   callp printf," str2  = %s \n",offset str2
  26.   callp printf," dword2= %i \n",dw2
  27.   callp printf," dword3= %i \n",dw3
  28.  
  29.   callp printf,"Enter a float:"
  30.   callp scanf,"%f",offset f1
  31.  
  32.   callp printf,"\n float = %f\n",f1
  33.   callp printf," float(0) = %x\n",dptr [f1]
  34.   callp printf," float(4) = %x\n",dptr [f1+4]
  35.  
  36.   ret
  37. main endp
  38.  
  39. end
  40.  
  41.